package org.dreamwork.jasmine2.web.controls.pdf.controls;

import org.dreamwork.jasmine2.web.controls.pdf.DocumentInfo;
import org.dreamwork.jasmine2.web.controls.pdf.PDFFont;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 2010-10-11
 * Time: 16:43:47
 */
public class PDFFontControl extends AbstractPDFContainer {
    private PDFFont font = new PDFFont ();

    @Override
    public void setName (String name) {
        font.setName (name);
    }

    public void setUrl (String url) {
        font.setUrl (url);
    }

    public void setCache (boolean cache) {
        font.setCache (cache);
    }

    public void setEmbedded (boolean embedded) {
        font.setEmbedded (embedded);
    }

    @Override
    public void init () {
        super.init ();
        DocumentInfo info = (DocumentInfo) context.getAttribute (PDF_Document_Info_Key);
        if (info != null)
            info.addFont (font);
    }
}